GtkFileChooserButton: Also emit 'file-set' when changing the selection through the...
authorFederico Mena Quintero <federico@gnome.org>
Sat, 22 Jun 2013 00:14:36 +0000 (19:14 -0500)
committerFederico Mena Quintero <federico@gnome.org>
Sat, 22 Jun 2013 00:14:36 +0000 (19:14 -0500)
https://bugzilla.gnome.org/show_bug.cgi?id=696498

gtk/gtkfilechooserbutton.c

index c2c686f3b2f9afdf4eaa08012fb86943cd5eb3fd..06bf946306095cd3edc061f76a2b286c6f4f9f03 100644 (file)
@@ -2712,12 +2712,15 @@ static void
 combo_box_changed_cb (GtkComboBox *combo_box,
                      gpointer     user_data)
 {
+  GtkFileChooserButton *button = GTK_FILE_CHOOSER_BUTTON (user_data);
+  GtkFileChooserButtonPrivate *priv = button->priv;
   GtkTreeIter iter;
+  gboolean file_was_set;
+
+  file_was_set = FALSE;
 
   if (gtk_combo_box_get_active_iter (combo_box, &iter))
     {
-      GtkFileChooserButton *button = GTK_FILE_CHOOSER_BUTTON (user_data);
-      GtkFileChooserButtonPrivate *priv = button->priv;
       gchar type;
       gpointer data;
 
@@ -2736,7 +2739,10 @@ combo_box_changed_cb (GtkComboBox *combo_box,
        case ROW_TYPE_BOOKMARK:
        case ROW_TYPE_CURRENT_FOLDER:
          if (data)
-           gtk_file_chooser_button_select_file (GTK_FILE_CHOOSER (button), data, NULL);
+           {
+             gtk_file_chooser_button_select_file (GTK_FILE_CHOOSER (button), data, NULL);
+             file_was_set = TRUE;
+           }
          break;
        case ROW_TYPE_VOLUME:
          {
@@ -2746,6 +2752,7 @@ combo_box_changed_cb (GtkComboBox *combo_box,
            if (base_file)
              {
                gtk_file_chooser_button_select_file (GTK_FILE_CHOOSER (button), base_file, NULL);
+               file_was_set = TRUE;
                g_object_unref (base_file);
              }
          }
@@ -2757,6 +2764,9 @@ combo_box_changed_cb (GtkComboBox *combo_box,
          break;
        }
     }
+
+  if (file_was_set)
+    g_signal_emit (button, file_chooser_button_signals[FILE_SET], 0);
 }
 
 /* Calback for the "notify::popup-shown" signal on the combo box.